﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html"/>
  <xsl:template match="albums">
    <HTML>
      <BODY>
        <TABLE BORDER="1" style="border-style:none;">
          <TR>
            <TD>
              <strong>Album-Name</strong>
            </TD>
            <TD>
              <strong>Artist</strong>
            </TD>
            <TD>
              <strong>Year</strong>
            </TD>
            <TD>
              <strong>Price</strong>
            </TD>
            <TD>
              <strong>Songs</strong>
            </TD>
          </TR>
          <xsl:apply-templates select="album"/>
        </TABLE>
      </BODY>
    </HTML>
  </xsl:template>
  <xsl:template match="album">
    <TR>
      <TD>
        <xsl:value-of select="name"/>
      </TD>
      <TD>
        <xsl:value-of select="artist"/>
      </TD>
      <TD>
        <xsl:value-of select="year"/>
      </TD>
      <TD>
        <xsl:value-of select="price"/>
      </TD>
      <TD>
        <xsl:apply-templates select="songs"/>
      </TD>
    </TR>
  </xsl:template>

  <xsl:template match="songs">
    <xsl:for-each select="song">
      <xsl:value-of select="title"/>,<xsl:value-of select="duration"/>
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>

